From 01a2aa498842ab108aec8cdd8524a991ef0b6f2b Mon Sep 17 00:00:00 2001 From: "smh22@firebug.cl.cam.ac.uk" Date: Fri, 25 Mar 2005 19:06:12 +0000 Subject: [PATCH] bitkeeper revision 1.1236.43.13 (42446124G6lMmGOZuWoCX4Jlr7Hj_w) partial fix for save/migrate signed-off-by: steven@xensource.com --- BitKeeper/etc/logging_ok | 1 + linux-2.6.11-xen-sparse/drivers/xen/privcmd/privcmd.c | 8 +++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/BitKeeper/etc/logging_ok b/BitKeeper/etc/logging_ok index e872421227..923095c66a 100644 --- a/BitKeeper/etc/logging_ok +++ b/BitKeeper/etc/logging_ok @@ -72,6 +72,7 @@ rneugeba@wyvis.research.intel-research.net sd386@font.cl.cam.ac.uk shand@spidean.research.intel-research.net smh22@boulderdash.cl.cam.ac.uk +smh22@firebug.cl.cam.ac.uk smh22@labyrinth.cl.cam.ac.uk smh22@tempest.cl.cam.ac.uk smh22@uridium.cl.cam.ac.uk diff --git a/linux-2.6.11-xen-sparse/drivers/xen/privcmd/privcmd.c b/linux-2.6.11-xen-sparse/drivers/xen/privcmd/privcmd.c index c2cdbf9e72..219b218920 100644 --- a/linux-2.6.11-xen-sparse/drivers/xen/privcmd/privcmd.c +++ b/linux-2.6.11-xen-sparse/drivers/xen/privcmd/privcmd.c @@ -88,6 +88,8 @@ static int privcmd_ioctl(struct inode *inode, struct file *file, { int j, n = ((mmapcmd.num-i)>PRIVCMD_MMAP_SZ)? PRIVCMD_MMAP_SZ:(mmapcmd.num-i); + + if ( copy_from_user(&msg, p, n*sizeof(privcmd_mmap_entry_t)) ) return -EFAULT; @@ -96,6 +98,7 @@ static int privcmd_ioctl(struct inode *inode, struct file *file, struct vm_area_struct *vma = find_vma( current->mm, msg[j].va ); + if ( !vma ) return -EINVAL; @@ -151,6 +154,7 @@ static int privcmd_ioctl(struct inode *inode, struct file *file, addr = m.addr; for ( i = 0; i < m.num; i++, addr += PAGE_SIZE, p++ ) { + if ( get_user(mfn, p) ) return -EFAULT; @@ -166,10 +170,12 @@ static int privcmd_ioctl(struct inode *inode, struct file *file, v = w; } + ret = 0; break; batch_err: + printk(KERN_ALERT "XXX SMH: ERROR IN MMAPBATCH\n"); printk("batch_err ret=%d vma=%p addr=%lx num=%d arr=%p %lx-%lx\n", ret, vma, m.addr, m.num, m.arr, vma->vm_start, vma->vm_end); break; @@ -183,7 +189,7 @@ static int privcmd_ioctl(struct inode *inode, struct file *file, pgd_t *pgd = pgd_offset_k(m2pv); pud_t *pud = pud_offset(pgd, m2pv); pmd_t *pmd = pmd_offset(pud, m2pv); - unsigned long m2p_start_mfn = pfn_to_mfn(pmd_val(*pmd) >> PAGE_SHIFT); + unsigned long m2p_start_mfn = (*(unsigned long *)pmd) >> PAGE_SHIFT; ret = put_user(m2p_start_mfn, (unsigned long *)data) ? -EFAULT: 0; } break; -- 2.30.2